Skip to content

Read stdout from sourcekit-lsp in binary mode instead of text mode #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 7, 2024

self.process.stdout.read reads a number of Unicode characters, but the Content-Length specifies number of bytes. This started causing deterministic issues since swiftlang/sourcekit-lsp#1861 is logging messages from package loading, which contains emojis.

Switch stdout and stderr to binary mode and manually decode them into UTF-8 when needed.

`self.process.stdout.read` reads a number of Unicode characters, but the `Content-Length` specifies number of bytes. This started causing deterministic issues since swiftlang/sourcekit-lsp#1861 is logging messages from package loading, which contains emojis.

Switch `stdout` and `stderr` to binary mode and manually decode them into UTF-8 when needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants